#include <stdio.h>
#include <stdlib.h>
#include "objc-port.h"

/* use this keyword for more optimization */
/* __sealed__ */
@interface Fibonacchi : Object
- (long)fibonacchiWithValue:(long)aValue;
@end

@implementation Fibonacchi
- (long)fibonacchiWithValue:(long)aValue
{
  if (aValue < 2)
    return aValue;
  else
    return [self fibonacchiWithValue: aValue-1] +
           [self fibonacchiWithValue: aValue-2];
}
@end

int
main(int argc, char **argv)
{
  Fibonacchi *fb;
  long n = 35;

  if (argc > 1)
    n = atol(argv[1]);

  fb = (Fibonacchi *)[Fibonacchi new];
  [fb fibonacchiWithValue: n];
  [fb free];

  return 0;
}

